<template>
	<view class="Main">
		<view class="Item" v-for='A,B in Data' :key="B">
			<image :src="A.avatar" class="L"></image>
			<view class="R">
				<view class="T">
					<view class="name">
						{{A.nickname}}
					</view>
					<view class="Time">
						加入时间：{{Subst(A.ctime)}}
					</view>
				</view>
				<view class="M">
					<view class="Income">
						联系电话：{{A.mobile}}
					</view>
					<view class="RefeRence">
						推荐人：{{A.parent}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				page: 1,
				Data: []
			};
		},
		onLoad(O) {
			this.id = parseInt(O.id)
			this.getlist()
		},
		methods: {
			Subst(value) {
				let A = value.substring(0, 10)
				return A
			},
			getlist(e) {
				this.$api.Myson({
					user_id: this.id,
					page: this.page,
					limit: 20,
				}, res => {
					if (res.data.length > 0) {
						this.Data.push(...res.data)
					} else {
						this.$u.toast('没有更多数据了')
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.Main {
		.Item {
			display: flex;
			padding: 30rpx 20rpx;
			margin: 10rpx 30rpx;
			background-color: #202226;
			border-radius: 20rpx;

			.L {
				width: 72rpx;
				height: 72rpx;
				border: 1px solid rgb(234, 203, 154);
				border-radius: 50%;
				margin-right: 20rpx;
			}

			.R {
				flex: 1;

				.T {
					margin-bottom: 40rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.name {
						font-size: 32rpx;
						font-weight: bold;
						color: #b9b9b9;
					}

					.Time {

						font-size: 20rpx;
						color: #fff;
					}

					.LookDown {
						width: 140rpx;
						height: 40rpx;
						border: 1px solid rgb(234, 203, 154);
						opacity: 1;
						border-radius: 24rpx;
						color: #6ADFD9;
						font-size: 24rpx;
						text-align: center;
						line-height: 40rpx;
					}
				}

				.M {
					margin-bottom: 20rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 24rpx;
					color: #999999;

					.Income {
						text {
							color: #f35831;
						}
					}

					.RefeRence {}
				}

				.B {
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 24rpx;
					color: #999999;

					.Tel {}

					.Time {}
				}
			}
		}

	}
</style>